home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Archives / ARexxTools / FDMacrosBG1.lha / Search.fd < prev    next >
Encoding:
Text File  |  1995-06-23  |  1.2 KB  |  43 lines

  1. /*  Search - semi-case insensative searching/
  2. **  $VER: Search V1_0 05-25-95
  3. **  by Brian Gragg
  4. **
  5. **  To use, highlight any columns you want to search and then run this macro.
  6. **  Remember you can select non-continguous rows by holding the CTRL key down.
  7. **  The macro will convert the text string you indicate to all UPPER case, all
  8. **  lower case and with the first letter Upper case and search for any of these.
  9. **  If you want to search for other mixed case stuff, use the Query menu item
  10. **  just remember that it is case sensative :(
  11. **
  12. */
  13.  
  14. OPTIONS RESULTS
  15.  
  16. 'RequestText "Case Insensative Search" "Search for what text?" '
  17. searchtext = RESULT
  18.  
  19. IF searchtext="RESULT" THEN EXIT
  20.  
  21. text1 = UPPER(searchtext)
  22. text2 = TRANSLATE(searchtext,XRANGE('a','z'),XRANGE('A','Z'))
  23. text3 = LEFT(text1,1) || SUBSTR(text2,2)
  24.  
  25. NumColumns
  26. columns = RESULT
  27.  
  28. string = ""
  29. DO c=1 TO columns
  30.     IsColumnSelected c
  31.     IF RESULT = 1 THEN DO
  32.         IF LENGTH(string)>0 then string = string || " OR "
  33.  
  34.         GetColumnName POSITION c
  35.         name = RESULT
  36.         string = string || 'Contains('name',"'text1'") OR Contains('name',"'text2'") OR Contains('name',"'text3'")'
  37.     END
  38. END
  39.  
  40. IF string="" THEN 'ShowMessage 1 1 "Columns must be selected first" "" "" "Okay" "" ""'
  41.  
  42. 'Query 'string
  43.